import { requestGet, requestPost, requestPut } from '../utils/requestApi';

// const baseUrl = 'https://api.e-chinacycle.com';
// const baseUrl = 'http://47.102.126.217:10008';
const baseUrl = 'http://47.102.126.217:8930';

export const getVenuesList = (str) => {
  return requestGet(`${baseUrl}/${str}`);
};

export function getList(urlPath, payload) {
  return requestGet(`${baseUrl}/${urlPath}`, payload);
}

export function postMethod(urlPath, payload) {
  return requestPost(`${baseUrl}/${urlPath}`, payload);
}

export function getDetail(urlPath, payload) {
  return requestGet(`${baseUrl}/${urlPath}/${payload.id}`);
}
export function getNewsInfo(urlPath, payload) {
  return requestGet(`${baseUrl}/${urlPath}/${payload.id}`, payload);
}

export function addItem(urlPath, payload) {
  return requestPost(`${baseUrl}/${urlPath}`, payload);
}

export function getShareImage(urlPath, payload) {
  return requestPost(`${baseUrl}/${urlPath}`, payload);
}

export function getWechatConfig(params) {
  return requestGet(`${baseUrl}/wechat/config`, params);
}

// 短信
export function sendPhoneVerificationCode(payload) {
  return requestPost(`${baseUrl}/web/login/phone-verification-code`, payload);
}

export async function postExhibitor(payload) {
  return requestPost(`${baseUrl}/exhibitor`, payload);
}

export async function postStaticPage(payload) {
  return requestPost(`${baseUrl}/static-page`, payload);
}
//上传图片
export async function postFile(payload) {
  return requestPost(`${baseUrl}/file`, payload);
}
